package com.pi.iot.repository.constants.lock;

public enum PiLockTypeEnum {
  NB_LOCK_WN1("1B-A45", "NB长短租(蜗牛款铝合金)"),
  NB_LOCK_WN2("0B-A10", "NB长短租-（蜗牛款不锈钢）"),
  HZ_TELCOM_LAB("0B-A31", "杭州电信-（不锈钢机房锁）"),
  HZ_TELCOM_ELECTRIC_LAB_LOCK("0B-A40", "杭州电信-电控锁"),
  NB_LOCK_HOUSE_DOOR("1B-A37", "NB长短租-内门锁"),
  DESSMANN_CUSTOM_MADE("1B-A42", "德施曼定制款001(NB)"),
  
  ;
  private PiLockTypeEnum(String firmwareSign, String desc) {
    this.firmwareSign = firmwareSign;
    this.desc = desc;
  }
  private String firmwareSign;
  private String desc;
  public String getFirmwareSign() {
    return firmwareSign;
  }
  public void setFirmwareSign(String firmwareSign) {
    this.firmwareSign = firmwareSign;
  }
  public String getDesc() {
    return desc;
  }
  public void setDesc(String desc) {
    this.desc = desc;
  }
  
  public static boolean hasOffBatteryAlarm(String firmwareVersion){
    return null != firmwareVersion 
        && firmwareVersion.indexOf(HZ_TELCOM_ELECTRIC_LAB_LOCK.getFirmwareSign()) >= 0;
  }
}
